<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ include file="/pages/common/header.jsp"%>
</head>
<body>
	<div class="contentBody contentborder">
		<div class="tab-pane" id="tabPane">
			<div id="message"><%=message %></div>
			<div class="tab-page">
				 <h1 class="tab">用户列表</h1>
 				 <div class="contentborder">
                	 <jdf:form bean="request" scope="request">
						<form action="<%=dynamicDomain%>/user/page" method="post" name="User" id="User">
							 <table class="inputTable">
			                 	<tr>
									<td nowrap class="label cancelBorderLeft">
										<label for="search_EQS_loginName">登录名：</label>
									</td>
									<td class="content">
										<input type="text" name="search_EQS_loginName" />
									</td>
									<td nowrap class="label">
										<label for="search_EQI_objectId">用户ID：</label>
									</td>
									<td class="content">
										<input type="text" name="search_EQI_objectId" />
									</td>
			                 	</tr>
			                 	<tr>
									<td nowrap class="label cancelBorderLeft">
										<label for="search_LIKES_userName">用户名：</label>
									</td>
									<td class="content">
										<input type="text" name="search_LIKES_userName" />
									</td>
									<td class="label ">
                                        <label for="search_EQI_type">用户类型：</label>
                                    </td>
                                    <td class="content">
                                        <select name="search_EQI_type" id="typeSelect">
                                            <option value="">请选择</option>
                                            <jdf:select dictionaryId="104" valid="true"/>
                                        </select>
                                    </td>
			                 	</tr>
			                 	<tr>
                                	<td class="bottomLabel" nowrap colspan="4">
                                		<div class="right">
											<button type="reset" class="button_common">重置</button>
											<button type="submit" class="button_common">查询</button>
                                		</div>
									</td>
			                 </table>
			            </form>
			        </jdf:form>
				</div>
				<div class="contentborder listArea">
					<div class="toolBar">
		 				<button type="button" onclick="window.location.href='<%=dynamicDomain%>/user/create'">增加</button>
					</div>
					<div id="tableDiv">
						<jdf:table items="items"  retrieveRowsCallback="limit" var="currentRowObject" filterRowsCallback="limit" sortRowsCallback="limit" action="page">
							<jdf:export view="csv" fileName="user.csv" tooltip="导出CSV" imageName="csv" />
							<jdf:export view="xls" fileName="user.xls" tooltip="导出EXCEL" imageName="xls" />
							<jdf:row>
								<jdf:column property="objectId" title="用户ID" style="width: 10%" />
								<jdf:column property="loginName" title="登录名" style="width:20%" />
								<jdf:column property="userName" title="用户名" style="width: 30%" />
								<jdf:column property="type" title="类型" style="width: 10%">
									<jdf:columnValue dictionaryId="104" value="${currentRowObject.type}"/>
								</jdf:column>
								<jdf:column alias="操作" sortable="false" viewsAllowed="html" style="width: 30%">
									<a href="<%=dynamicDomain%>/user/editUserRole/${currentRowObject.objectId}" class="button">配置角色</a>
									<a href="<%=dynamicDomain%>/extendUser/edit/${currentRowObject.id}" class="button">修改</a>
									<a href="javascript:unlock('${currentRowObject.loginName}')" class="unlock button">解锁</a>
								</jdf:column>
							</jdf:row>
						</jdf:table>
					</div>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript">
	   function unlock(loginName){
		   $(".unlock").attr("disabled",true);
		   $.ajax({
               url:"<%=dynamicDomain%>/user/unlock/" + loginName + "?timstamp=" + (new Date()).valueOf(),
               type:'post',
               dataType:'json',
               success:function(msg){
                   if(msg.result) {
                	   showMessage("操作成功",60000);
                   }
                   $(".unlock").attr("disabled",false);
               }
		   });
	   }
	</script>
</body>
</html>